import 'package:flutter/material.dart';
import 'package:flutter_plant_ui/constants.dart';
import 'package:flutter_plant_ui/screen/detail/components/icon_card.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

class ImageAndIcons extends StatelessWidget {
  const ImageAndIcons({Key key, this.size}) : super(key: key);
  final Size size;

  @override
  Widget build(BuildContext context) {
    List<String> images = [
      "https://cdn.pixabay.com/photo/2013/11/26/01/49/flowers-218487_960_720.jpg",
      "https://cdn.pixabay.com/photo/2014/09/19/13/37/lily-452491_960_720.jpg",
      "https://cdn.pixabay.com/photo/2016/11/22/21/49/lilies-1850750_960_720.jpg"
    ];
    return Padding(
      padding: EdgeInsets.only(
        bottom: kDefaultPadding * 3,
      ),
      child: SizedBox(
        height: size.height * 0.8,
        child: Row(
          children: [
            Expanded(
              child: Padding(
                padding: EdgeInsets.symmetric(vertical: kDefaultPadding * 3),
                child: Column(
                  children: [
                    Align(
                      alignment: Alignment.topLeft,
                      child: IconButton(
                        padding:
                            EdgeInsets.symmetric(horizontal: kDefaultPadding),
                        icon: SvgPicture.asset("assets/icons/back_arrow.svg"),
                        onPressed: () {
                          Navigator.pop(context);
                        },
                      ),
                    ),
                    Spacer(),
                    IconCard(icon: "assets/icons/sun.svg"),
                    IconCard(icon: "assets/icons/icon_2.svg"),
                    IconCard(icon: "assets/icons/icon_3.svg"),
                    IconCard(icon: "assets/icons/icon_4.svg"),
                  ],
                ),
              ),
            ),
            Container(
              height: size.height * 0.8,
              width: size.width * 0.75,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(63),
                  bottomLeft: Radius.circular(63),
                ),
                color: Colors.transparent,
                boxShadow: [
                  BoxShadow(
                    offset: Offset(0, 10),
                    blurRadius: 60,
                    color: kPrimaryColor.withOpacity(0.29),
                  ),
                ],
                image: DecorationImage(
                  alignment: Alignment.centerLeft,
                  fit: BoxFit.cover,
                  image: AssetImage("assets/images/detail.jpg"),
                ),
              ),
              // child: ClipRRect(
              //   borderRadius: BorderRadius.only(
              //     topLeft: Radius.circular(63),
              //     bottomLeft: Radius.circular(63),
              //   ),
              //   child: Swiper(
              //     itemBuilder: (BuildContext context, int index) {
              //       return new Image.network(
              //         images[index],
              //         fit: BoxFit.cover,
              //       );
              //     },
              //     autoplay: true,
              //     itemCount: images.length,
              //     pagination: new SwiperPagination(),
              //   ),
              // ),
            ),
          ],
        ),
      ),
    );
  }
}
